all:	clean interface stubs

interface: ../../java/jni/PcapInterface.h
	mkdir ./include/jni
	sed 's/\n/ /' ../../java/jni/PcapInterface.h > ./include/jni/PcapInterface.h

stubs: ./include/jni/PcapInterface.h ./src/PcapWrapper.cc
	# '**************   Building stubs   **************'		
	g++ -g -fPIC -I /usr/include -I /usr/include/c++ \
	-I ${JAVA_HOME}/include	-I ${JAVA_HOME}/include/linux \
	-I ./include -I ./include/jni \
	-L ./lib \
	 -shared -o ./build/libPcapWrapper.so ./src/PcapWrapper.cc -lpcap -lstdc++

clean:
	rm -rfv *~ \
	rm -rfv ./include/jni \
	rm -rfv ./build/* \
	rm -rfv ./dist/*
